home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / DispMod.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  4.2 KB  |  186 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: DispMod.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODDispatchModule_xh
  18. #define SOM_ODDispatchModule_xh
  19.  
  20. class ODDispatchModule;
  21.  
  22. #define ODDispatchModule_MajorVersion 1
  23. #define ODDispatchModule_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODObject_xh
  31. #include <ODObject.xh>
  32. #endif
  33.  
  34. #ifndef ODDispatchModule_API
  35. #define ODDispatchModule_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODDispatchModule;
  50. class ODSession;
  51.  
  52. /*
  53.  * End of user-defined types.
  54.  */
  55.  
  56. #ifdef OLDIBMSOMAPISUPPORT
  57. #define ODDispatchModuleCClassData ODDispatchModuleClassData
  58. #define ODDispatchModuleNewClass(major,minor) somNewVersionedClassReference(ODDispatchModule,major,minor)
  59. #endif
  60.  
  61. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  62. #define ODDispatchModuleMetaClass SOMClass
  63.  
  64. #if PRAGMA_ALIGN_SUPPORTED
  65. #  pragma options align=power
  66. #endif
  67.  
  68. /* The API to the ODDispatchModule class object, and the methods it introduces. */
  69. SOMEXTERN struct ODDispatchModuleClassDataStructure {
  70. #ifdef OLDIBMSOMAPISUPPORT
  71.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  72. #else
  73.     long zero;
  74. #endif
  75.     somStaticClassInfo *sci;
  76.     somDToken        instanceDataToken;
  77.     long reserved [3];
  78.     somMToken InitDispatchModule;
  79.     somMToken Dispatch;
  80. } SOMDLINK ODDispatchModuleClassData;
  81.  
  82. #if PRAGMA_ALIGN_SUPPORTED
  83. #  pragma options align=reset
  84. #endif
  85.  
  86. #if !defined(ODDispatchModule_Class_Source) && !defined(SOM_Module_dispmod_Source)
  87. #if PRAGMA_IMPORT_SUPPORTED
  88. #pragma import list ODDispatchModuleClassData
  89. #endif
  90. #endif
  91.  
  92.  
  93. /*
  94.  * -- Typedefs and inline method declarations for left path inherited methods
  95.  * -- are omitted because this compilation had -museinheritedmethods in effect
  96.  */
  97.  
  98.  
  99. /*
  100.  * -- Typedefs for ODDispatchModule Method Procedures
  101.  */
  102. SOMEXTERN {
  103. typedef void   (* SOMLINK somTD_ODDispatchModule_InitDispatchModule)(ODDispatchModule *somSelf, Environment *ev,
  104.         ODSession* session);
  105. typedef ODBoolean   (* SOMLINK somTD_ODDispatchModule_Dispatch)(ODDispatchModule *somSelf, Environment *ev,
  106.         ODEventData* event,
  107.         ODEventInfo* eventInfo);
  108. }
  109.  
  110. #endif /* ODDispatchModule_API */
  111.  
  112.  
  113. /*
  114.  * -- This emitter treats Method Tokens as Thunks by default.
  115.  * -- Use the sc modifier "nothunks" to change this default
  116.  */
  117. #undef somresolve_
  118. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  119.  
  120. /*
  121.  * -- The C++ Wrapper Class for ODDispatchModule
  122.  */
  123. class ODDispatchModule : public ODObject
  124. {
  125. public:
  126.  
  127. // ODDispatchModule::new registers use of the class object, and then uses somNew
  128. // to allocate memory and load the object method table pointer. 
  129. void *operator new(size_t size)
  130. {
  131.     SOM_IgnoreWarning(size);
  132.     // Allocate memory using the default allocator for ODDispatchModule, and
  133.     // clear mem & set method table pointer, call basic initialization
  134. #ifdef SOMCHKNULL
  135.     void * __somResult = (void *)
  136.       somNewObject(ODDispatchModule);
  137.     SOMCHKNULL(__somResult);
  138.     return __somResult;
  139. #else
  140.     return (void*) somNewObject(ODDispatchModule);
  141. #endif
  142. }
  143.  
  144. // ODDispatchModule::delete uses the default deallocator for the object's class.
  145. void operator delete(void * obj)
  146. {
  147.     if (obj) {
  148.         SOM_Resolve(obj,SOMObject,somFree)
  149.            ( (SOMObject*) obj );
  150.     }
  151. }
  152.  
  153. /* method: InitDispatchModule */
  154. void   InitDispatchModule(Environment *ev,
  155.         ODSession* session)
  156. {
  157.    SOM_ResolveD(this,ODDispatchModule,ODDispatchModule,InitDispatchModule)
  158.     (this,ev,session);
  159. #ifdef SOMCHKEXCEPT
  160.       SOMCHKEXCEPT;
  161. #endif
  162. }
  163.  
  164. /* method: Dispatch */
  165. ODBoolean   Dispatch(Environment *ev,
  166.         ODEventData* event,
  167.         ODEventInfo* eventInfo)
  168. {
  169.    #ifdef SOMCHKEXCEPT
  170.    ODBoolean __somResult = 
  171.       SOM_ResolveD(this,ODDispatchModule,ODDispatchModule,Dispatch)
  172.     (this,ev,event,eventInfo);
  173.       SOMCHKEXCEPT;
  174.    return __somResult;
  175. #else
  176.    return SOM_ResolveD(this,ODDispatchModule,ODDispatchModule,Dispatch)
  177.     (this,ev,event,eventInfo);
  178. #endif
  179. }
  180.  
  181. };   /* ODDispatchModule */
  182.  
  183.  
  184.  
  185. #endif       /* SOM_ODDispatchModule_xh */
  186.